<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
		$(function() {
			//			console.log( $("p:last").siblings() )
			//			console.log( $("div").find("span") )
			/*$("xxxxx").each(function(){
				$(this).find("span")
			});*/
			//			console.log( $("p").children("span") );
//			console.log($("p").filter(".selected, :first"));
			
			var $p = $("p").filter(function(index){
				return $("span", this).length > 0;
			});
			console.log($p);
		});
	</script>

	<body>
		<p>Hello</p>

		<div>
			<p>
				<a>yyyyy</a>
				<span>Hello Again</span>
			</p>
		</div>

		<p>And Again
			<span>
				<a>XXXX</a>
			</span>
		</p>
		<p>Hello</p>
		<p>Hello Again</p>
		<p class="selected">And Again</p>
		
		<p>How are you?</p>
		
		<p>
			<ul>
				<li></li>
			</ul>
		</p>
	</body>

</html>